<!DOCTYPE html>
<html lang="en">

<head>
  <title>redux</title>
</head>

<body>
  <script src="https://cdn.bootcdn.net/ajax/libs/redux/4.0.5/redux.js"></script>
  <script>
    function counter(state = {cnt:0}, action) {
      if(action.o) action.o.id = 'zdl'
      switch (action.type) {
        case 'INCREMENT':
          state.cnt++
        case 'DECREMENT':
          state.cnt++
        default:
          return state
      }
    }
    let o = {}
    let store = Redux.createStore(counter)

    store.subscribe(() => console.log(store.getState()))

    store.dispatch({ type: 'INCREMENT' , o}) // 1
    console.log(o)
    store.dispatch({ type: 'INCREMENT' }) // 2
    store.dispatch({ type: 'DECREMENT' }) // 1
  </script>
</body>

</html>